package com.atguigu.product.service.impl;

import java.math.BigDecimal;

import com.atguigu.product.bean.Product;
import com.atguigu.product.service.ProductService;
import io.micrometer.core.instrument.util.TimeUtils;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {

    @Override
    public Product getProductById(long productId) {
        Product product = new Product();
        product.setId(productId);
        product.setPrice(new BigDecimal("99"));
        product.setProductName("苹果" + productId);
        product.setNum(2);
        //int i=1/0;

        //睡眠100秒
     /*   try {
            Thread.sleep(1000*100);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }*/
        return product;
    }
}
